Repository navigation
fix(pm): the regeneration carry lists a renamed path by both sides, not its destination alone - #34049
Conversation
… lists its source unexplainedPathsBetween listed a hop's changed paths, and the PR's own delta at each head, with `git diff -z --name-only` and rename detection on, so a rename was listed by its destination alone. A hop moving a reviewed file onto a prose face (skills/a/rules/security.md -> content/docs/security.md) listed only the prose path and carried the record. Both reads now go through one argv, CARRY_DIFF_ARGV, with --no-renames: a rename reads as a delete plus an add. The self-test's fake git answers only that exact argv; one argument pin and one real-git row (temp repo, GIT_* stripped, no global or system config) are added. Claude-Session: https://claude.ai/code/session_01ADHkmQk5t2iVNRP4bBd2qx Co-authored-by: Claude <noreply@anthropic.com>
…older governed-merges git fixtures run GIT_*-free The queue guard's regen battery fake git parsed `diff -z --name-only A B` positionally, so the carry's `--no-renames` argv read as rev A. It now takes the two revs from the tail of argv. The older real-git fixtures in check-governed-merges' self-test spawned git with the inherited environment; under a hook's GIT_INDEX_FILE or GIT_DIR they acted on the real checkout. Each now passes env: gitFreeEnv() (GIT_*_DATE added on top for the backdated commits), per GIT_ENV_ISOLATION_RULE. Claude-Session: https://claude.ai/code/session_01ADHkmQk5t2iVNRP4bBd2qx Co-authored-by: Claude <noreply@anthropic.com>
…e holds CARRY_DIFF_ARGV is read only inside record-recognisers (the helper and its self-test fake), so it is not exported and the header export list is unchanged; the `self-test-reads` marker stays on the line the dispatch-gates census pins. Claude-Session: https://claude.ai/code/session_01ADHkmQk5t2iVNRP4bBd2qx Co-authored-by: Claude <noreply@anthropic.com>
|
domain:skills#1 · os-steve · session_01ADHkmPd7uRqHauEehGPr19 Contract reviewServed-tier: Inputs read: card #33578 (body, triage 6887492591, added scope 6887759291, claim 6897803131, claim amendment 6897818459, os-dev-report 6898336127; no earlier record on the card, no comment on the PR), PR #34049 (body, 3-file list, net diff against Check-runs on ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Implemented-by: VERDICT: PASS |
…-cceg2o # Conflicts: # scripts/pm/record-recognisers.mjs
|
domain:skills#1 · os-steve · session_01ADHkmPd7uRqHauEehGPr19 Contract reviewServed-tier: Delta round on record 6898489993 (PASS on Check-runs on ① Derived judgments
② Semver levelUnchanged and right: three ③ Boundary flags
④ Design judgment
Implemented-by: VERDICT: PASS |
|
domain:skills#1 · os-steve · session_01ADHkmPd7uRqHauEehGPr19 席位核对 · ACCEPT · head
|
Requested by Steve · project thread
Fixes #33578
Clause-②: no
Metadata-protocol: none
维护者速读
--no-renames),改名同时列出源路径和目的路径。skills/a/rules/security.md→content/docs/security.md)只会看到文档路径,旧记录会被错误地延续到新 head。scripts/pm/内部工具与其自测,不发布任何包;回滚即还原本 PR 的提交。scripts/pm/record-recognisers.mjs的CARRY_DIFF_ARGV与unexplainedPathsBetween;同文件新增的真 git 自测行;check-governed-queue-guard.mjs假 git 一行。node scripts/pm/record-recognisers.mjs --self-test,预期 401 例全过。What changes
scripts/pm/record-recognisers.mjs(carry region):unexplainedPathsBetweenlists a hop's paths, and the pull request's own delta at each head, through one module-private argv,CARRY_DIFF_ARGV = ['diff', '-z', '--name-only', '--no-renames']. Both reads go through the onenameshelper, so the flag is spelled once. A rename now reads as a delete plus an add, so the source path is judged by the prose arm, themerge=os-regenattribute and the own-delta arm like any other path.--no-renames, and two cases are added (battery floor 22 → 24):diffthe carry sent isdiff -z --name-only --no-renames A B;skills/a/rules/security.mdmoved tocontent/docs/security.md; a plain rename-detecting diff lists only the destination (the blind spot, measured in the same row), andunexplainedPathsBetweenlistsskills/a/rules/security.md. The row runs withGIT_*stripped (gitFreeEnv),GIT_CONFIG_NOSYSTEM=1,GIT_CONFIG_GLOBAL=/dev/null, and-cidentity,commit.gpgsign=falseanddiff.renames=true, so it reads the same on any machine.scripts/pm/check-governed-queue-guard.mjs(claim amendment 6897818459, one line): the regen battery's fake git took the revs positionally ([, , , a, b]), so the new argv read--no-renamesas rev A and four guard cases went red. It now takes the two revs from the tail of argv. Forced test edit.scripts/pm/check-governed-merges.mjs(claim amendment 6897818459, card comment 6887759291): the older real-git self-test fixtures (the real prober, the derive, size, oversized-sweep, rename-size and banner fixtures, and the argv-rootinit/remote add) now passenv: gitFreeEnv(); the three backdated-commit spawns spreadgitFreeEnv()under theirGIT_*_DATEkeys. All of them already passed-c commit.gpgsign=false; the argv-rootinit/remote addmake no commit. Forced test edit (hygiene, no behaviour change).Why
A carried contract-review record re-runs
unexplainedPathsBetweenon the committed trees of eachRegen-provenance:hop. With git's default rename detection,git diff --name-onlylists a rename by its destination alone. A hop that moved a reviewed file onto a prose face listed only the prose path, the prose arm explained it, and the record carried to a head where a reviewed file had left its face. The own-delta read had the same blind spot. The queue guard's own row enumeration and its low-risk carry check already pass--no-renames; this brings the carry reader in line.Tests
record-recognisers self-test (head 6c6a5c9, after merging main)
node scripts/pm/record-recognisers.mjs --self-test→ exit 0,✓ record-recognisers self-test: 401 cases pass(the two new cases on top of main e71ecc1's set; 402 on the pre-merge head 80fb531, whose base was c3c0c30).Ablation: drop the no-renames flag (heads 80fb531 and 6c6a5c9)
node scripts/ablation-replace.mjs --file scripts/pm/record-recognisers.mjs --anchor "Object.freeze(['diff', '-z', '--name-only', '--no-renames'])" --replacement "Object.freeze(['diff', '-z', '--name-only'])" -- node scripts/pm/record-recognisers.mjs --self-testok mutation landed: anchor 1 -> 0, blob d15231d06d0f -> 9da9b7818a7d, exit 1,4 of 402 case(s) failed.ok mutation landed: anchor 1 -> 0, blob 03ae3466af62 -> 4352da5184ff, exit 1,4 of 401 case(s) failed.{"destinationOnly":["content/docs/security.md"],"unexplained":[]}), the new argument pin, and the two existing argv pins.git diff HEADempty and the file's hash equals its HEAD blob.Queue guard self-test
node scripts/pm/check-governed-queue-guard.mjs --self-test: with the carry change alone (head 0f2341b) exit 1, 4 of 534 failed (the regen battery's slipped-in, names-the-path, hand-resolved and prose-and-code cases). With the tail-reading fake: exit 0.check-governed-merges self-test under a hook-shaped environment
node scripts/pm/check-governed-merges.mjs --self-test→ exit 0.GIT_INDEX_FILE=SCRATCH/probe.index node scripts/pm/check-governed-merges.mjs --self-test→ exit 0, no index file written.Acceptance notes
check-governed-mergesself-test also spawns its own CLI (spawnSync(process.execPath, [scriptPath, …])) withprocess.env-based environments, and that child runs real git in the fixture roots. Those spawns were left as they are: the amendment scopes this PR to the fixtures' own git calls. carrier: pm(check-governed-merges): the self-test's own CLI children inherit GIT_* from the parent environment #34066.origin/main(e71ecc1) as a merge commit: the one conflict was the adjacentSELF_TEST_BATTERIESrows, resolved keeping both floors (this PR's regen battery 24, main's template battery 32). The delta against main is unchanged, +67 / -17 over the three files.check:pm-dispatch-gateswent red because the header export list grew by one line and moved theself-test-readsmarker off the line its census pins (record-recognisers.mjs:77). The argv is now module-private and the header is unchanged; the marker is back on line 77.Verification
Local gate round on head
6c6a5c9e(the merge of main, after the last commit):node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 36 commands from the threescripts/pm/paths; all 36 ran, all exit 0.--ranreconciliation:36 derived famil(ies) accounted for — 36 run, 0 NOT-MEASURED.check:pm-dispatch-gatesfast tier:2205 cases pass; 9 slow section(s) deferred. The same 36 were green on the pre-merge head80fb5317. Every family CI runs is read from this PR's check-runs, not re-run here.The 36 commands and their exit codes (head 6c6a5c9)
Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (CI)main, one pull request.scripts/pm/**only:skip-changeset)packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.